<template>
  <div>
    <van-sticky>
      <van-nav-bar
        :title="titleway"
        left-arrow
        @click-right="onClickRight"
        @click-left="onClickLeft"
      >
        <van-icon :name="share" slot="right" />
      </van-nav-bar>
    </van-sticky>
    <shareDom :show="show" @setSHow="setSHow"></shareDom>
  </div>
</template>

<script>
import share from "./share.png";
import shareDom from "../newsDtails/index";
export default {
  components: {
    shareDom
  },
  data() {
    return {
      share,
      show: false
    };
  },
  computed: {
    titleway() {
      return this.$route.meta.title || this.$route.query.menuname;
    }
  },
  methods: {
    setSHow() {
      this.show = false;
    },
    onClickRight() {
      this.show = true;
    },
    onClickLeft() {
    console.log("this.$route.query.left",this.$route.query.left)
    if (this.$route.query.left==='index') {
             this.$store.dispatch("acstartPage");
       this.$router.push({path:"/"})
    }else{
        this.$router.go(-1);
    }
     
    }
  },
 
  
  
};
</script>

<style lang="less">
.van-nav-bar {
  .van-icon {
    color: #272937;
    font-size: 20px;
  }
  .van-nav-bar__text {
    color: #272937;
  }
}
</style>
